package com.rong.shop.controller;

import com.rong.shop.pojo.AddressDistrict;
import com.rong.shop.service.IAddressDistrictService;
import com.rong.shop.service.IAddressService;
import com.rong.shop.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/addressDistricts")
public class AddressDistrictController extends BaseController{

    @Autowired
    private IAddressDistrictService addressDistrictService;

    @RequestMapping("findByParent")
    public JsonResult<List<AddressDistrict>> findByParent(String parent){

        List<AddressDistrict> datas = addressDistrictService.findByParent(parent);

        return new JsonResult<List<AddressDistrict>>(OK, datas);
    }


}
